import{selectAll} from '../../service/th/Deposit'
import{AddDeposit} from '../../service/th/Deposit'

export default {
    namespaced:true,
    state:{
       deposit:[],
       pageInfo:{},
    },
    mutations:{
        setDeposit(state,deposit){
         state.deposit=deposit
        },
        setPageInfo(state,pageInfo){
            state.pageInfo=pageInfo
        }

    },
    actions:{
        async add(context,DepositTwoDTO){
            console.log(DepositTwoDTO)
           await AddDeposit(DepositTwoDTO);
        },
        async select(context,info){
            let response =await selectAll(info);
           context.commit('setPageInfo',response);
          context.commit("setDeposit",response.data);
        }
    }
}